package com.yc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yc.entity.Collect;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * InnoDB free: 4096 kB Mapper 接口
 * </p>
 *
 * @author ly
 * @since 2022-06-07
 */
public interface CollectMapper extends BaseMapper<Collect> {
    @Insert("INSERT into collect VALUES (#{uid},#{ctid},NOW())")
    public Integer addCollect(Integer uid, Integer ctid);

    @Select("SELECT * from collect where uid=#{uid} and ctid=#{ctid}")
    public List<Collect> checkCollected(Integer uid,Integer ctid);

    @Delete("delete from collect where uid=#{uid} and ctid=#{ctid}")
    public boolean deletecollect(Integer uid, Integer ctid);
}
